SG Window Window Object
Hooked Property

©1998 by Stinga

Properties     Methods      Events     Constants     Error Codes
Description

Enables or disables message events.

Syntax

object.Hooked

The object is expression that evaluates to the Window object.

Remarks

When Hooked property is set to True, Window object will subclass attached window, fire events and call registered callback interface methods. Default value for this property is False, so to receive message events you must set it to True.
Normaly you attach window by assigning window handle (hWnd),   call EnableMessage to enable events for a specific message and the set Hooked property to True.

There is a difference between FreezeEvents method and Hooked property. Setting Hooked property to False disconnects Window object from the default Win32 window procedure (un-subclasses window). Setting FreezeEvents to False disables event firing but window still remains subclassed.

Example
Public WithEvents w as SGWindow.Window

Sub Form_OnLoad()
   set w = new SgWindow.Window
   w.hWnd = Me.hWnd
   w.EnableMessage wm_COMAND
   w.Hooked = True
End Sub